﻿using ReflectionStudio.Components.UserControls;
using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace WPFExcelReport
{
    public partial class MainWindow : DocumentBase
    {
        ViewModelBase vm;
        public MainWindow()
        {
            vm = new ViewModelBase();
            DataContext = vm;
            InitializeComponent();
            this.Name = "采购管理";

        }
        MessageInfo msg;
        ViewBase ui;
        public override void OnWorkflowIDChange(MessageEventArgs e)
        {
            base.OnWorkflowIDChange(e);
            string wfid = e.Info.Details;
            msg = e.Info;
            MainTab.Children.Clear();
            msg.ORDER = msg.ORDER.PadRight(9);
            switch (wfid)
            {
                case "EK02":
                    ui = new EK02();
                    MainTab.Children.Add(ui);
                    if (msg.ORDER.StartsWith("K"))
                    {
                        ((EK02)ui).VKAUF = msg.ORDER.Substring(0, 8);
                    }
                    else
                    {
                        ((EK02)ui).ORDERNUM = msg.ORDER.Substring(1, 8);
                    }
                    break;
                case "DEK02":
                    MainTab.Children.Clear();
                    ui = new TDEK02();
                    MainTab.Children.Add(ui);
                    break;
            }
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {


        }

    }
}
